package com.pie.face_pie.service;

import com.pie.face_pie.mapper.RegisterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DeadlineService {
    @Autowired
    private RegisterMapper registerMapper;
    public int checkDeadline(String id) {
        String grade = id.substring(0, 4);
        Date deadline = registerMapper.getDeadline(grade);
        Date now = new Date();
        if (now.before(deadline)) {
            return 1;
        }
        return 0;
    }
}
